*/
extern queue waypt_head;
+#if NEWQ
+extern QList<waypoint*> waypt_list;
+#endif
typedef struct filter_vecs {
filter_init f_init;
{
int i, ct = waypt_count(), serial = 0;
htable_t* htable, *bh;
- queue* elem, *tmp;
- extern queue waypt_head;
const char* snptr;
char* tmp_sn;
unsigned long last_crc;
bh = htable;
i = 0;
+#if NEWQ
+ // Why, oh, why is this format running over the entire waypoint list and
+ // modifying it? This seems wrong.
+ extern QList<waypoint*> waypt_list;
+ foreach(waypoint* waypointp, waypt_list) {
+ bh->wpt = waypointp;
+#else
+ queue* elem, *tmp;
+ extern queue waypt_head;
QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
bh->wpt = (waypoint*) elem;
+#endif
snptr = bh->wpt->shortname;
tmp_sn = strlower(xstrdup(snptr));
bh->crc = get_crc32(tmp_sn, strlen(snptr));
static void
transform_waypoints(void)
{
- queue *elem, *tmp;
route_head *rte;
rte = route_head_alloc();
track_add_head(rte);
break;
}
-
+#if NEWQ
+ foreach(waypoint* wpt, waypt_list) {
+#else
+ queue *elem, *tmp;
QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
waypoint *wpt = (waypoint *) elem;
+#endif
wpt = waypt_dupe(wpt);
switch (current_target) {
#include "garmin_fs.h"
#include "session.h"
-#define NEWQ 0 // Work in progress.
-
#if NEWQ
QList<waypoint*> waypt_list;
queue waypt_head; // This is here solely to freak out the formats that are
waypt_init(void)
{
mkshort_handle = mkshort_new_handle();
-#if !NEWQ
+#if NEWQ
+ waypt_list.clear();
+#else
QUEUE_INIT(&waypt_head);
#endif
}
delete wpt;
}
-void
-waypt_flush(queue *head)
-{
#if NEWQ
- foreach(waypoint* q, waypt_list) {
- waypt_free(q);
+void
+waypt_flush(queue* head) {
+ while (!waypt_list.isEmpty()) {
+ waypt_free(waypt_list.takeFirst());
}
+}
#else
+void
+waypt_flush(queue *head)
+{
queue *elem, *tmp;
QUEUE_FOR_EACH(head, elem, tmp) {
waypt_ct--;
}
}
-#endif
}
+#endif
void
waypt_flush_all()
qbackup = (queue *) xcalloc(1, sizeof(*qbackup));
QUEUE_INIT(qbackup);
#if NEWQ
-// Why doe sthis code exist?
-abort();
+// Why does this code exist?
+//abort();
#else
QUEUE_MOVE(qbackup, &waypt_head);
QUEUE_INIT(&waypt_head);
}
#if NEWQ
-abort();
+//abort();
#else
waypt_flush(&waypt_head);
QUEUE_INIT(&waypt_head);